*****Conscription and Military Service: Do They Result in Future Violent and Non-Violent Incarcerations and Recidivism?  Wang, Flores-Lagunes 2020*****
**This is the dofile that computes all the bounds estimates in the paper 
program define I2_pop_racial_be, eclass

marksample touse

set more off


****Total observation of the sample 
count if Census==0
sca n_sample_white$race =r(N) 
sca li n_sample_white$race

***The bounded support for the outcome
sca yu_white$race =1
sca li yu_white$race 
sca yl_white$race =0
sca li yl_white$race

****The total number of inmates in each year in scaler
**Year 1979
sum svy_male_inmate if study==1979 
sca svy_male_inmate79=r(mean)
sca list svy_male_inmate79 

**Year 1986
sum svy_male_inmate if study==1986
sca svy_male_inmate86=r(mean)
sca list svy_male_inmate86 

**Year 1991: State
sum svy_male_inmate if study==1991
sca svy_male_inmate91_state=r(mean)
sca list svy_male_inmate91_state 

**Year 1991: Federal
sum svy_male_inmate if study==19912
sca svy_male_inmate91_fed=r(mean)
sca list svy_male_inmate91_fed 

**Aggregate population 
sca svy_male_inmate_all=svy_male_inmate79+svy_male_inmate86+svy_male_inmate91_state+svy_male_inmate91_fed
sca list svy_male_inmate_all

*Count how many distinct birth months are there 
	distinct monthYear_group if birth_cohort==1
	local total_my=r(ndistinct) 
	
	*Generate new variable numering the birth month year group in the subsample
	tempvar new_my
	egen `new_my'=group(monthYear_group) if birth_cohort==1
	tab `new_my'
	
	**Scaler the population of the birth group 
    preserve 
  
    keep if Census>=2
	
	*The variable wn_birth is for the construction of incarceration rate for each birth month by eligibility status 
	tempvar wn_birth 
	egen `wn_birth'=total(birth), by(white eligible birthMonth birthYear)
	tab `wn_birth'
	sum `wn_birth'
	
	*The variable total_birth is for the denominator of the weighting of all the bounds for each birth month cohort 
	tempvar sum_birth 
	egen `sum_birth'=total(birth) if birth_cohort==1 
	tab `sum_birth' 
	
	sum `sum_birth' if birth_cohort==1 
	sca total_birth=r(mean) 
    sca li total_birth 
	
**Implementing Between Estimator (Between variable: birth month by year)** ; 
forvalues x=1(1)`total_my'{

	sum `wn_birth' if birth_cohort==1 & eligible==1 & `new_my'==`x'
    sca nz1_`x'=r(mean) 
    sca li nz1_`x' 

    sum `wn_birth' if birth_cohort==1 & eligible==0 & `new_my'==`x'
    sca nz0_`x'=r(mean) 
    sca li nz0_`x' 
	
	sca nz10_`x'=nz1_`x'+nz0_`x'
	sca li nz10_`x'
	
	}
  restore 

*Count how many distinct birth months are there 
	distinct monthYear_group if birth_cohort==1
	local total_my=r(ndistinct) 
	
forvalues x=1(1)`total_my'{  
  **Total incarceration rate E[Y] in the population 
  gen cond=1 if `new_my'==`x' & Y==1 & Census==0 
  replace cond=0 if cond==. & Census==0
  
  *Year 1979:  
  sum cond if study==1979 [w=W]
  sca n_79=(r(mean)*svy_male_inmate79)/(nz1_`x'+nz0_`x') 
  sca list n_79

  *Year 1986:  
  sum cond if study==1986 [w=W]
  sca n_86=(r(mean)*svy_male_inmate86)/(nz1_`x'+nz0_`x') 
  sca list n_86

  *Year 1991 State:  
  sum cond if study==1991 [w=W]
  sca n_91_state=(r(mean)*svy_male_inmate91_state)/(nz1_`x'+nz0_`x') 
  sca list n_91_state

  *Year 1991 Federal 
  sum cond if study==19912 [w=W]
  sca n_91_fed=(r(mean)*svy_male_inmate91_fed)/(nz1_`x'+nz0_`x') 
  sca list n_91_fed

  *Combine 1991 State and Federal 
  sca n_91=n_91_state+n_91_fed
  sca list n_91

  *Average incarceration rate in the 3 years (Weighted by Total Inmate Population)
  sca ej_`x'= (n_79*svy_male_inmate79 + n_86*svy_male_inmate86 + ///
  n_91_state*svy_male_inmate91_state+n_91_fed*svy_male_inmate91_fed)/svy_male_inmate_all
  sca list ej_`x'	   

  sca drop n_79 n_86 n_91 n_91_state n_91_fed
  drop cond
 
**E[Y|Z=1,T=0]
*Let cond stands for condition
gen cond=1 if T==0 & Z==1 & `new_my'==`x' & Y==1 & Census==0
replace cond=0 if cond==. & Census==0

*Year 1979:  
sum cond if study==1979 [w=W]
sca a79=r(mean)*svy_male_inmate79
sca list a79
sca n_79=(r(mean)*svy_male_inmate79)/(nz1_`x'*Cnt) 
sca list n_79

*Year 1986:  
sum cond if study==1986 [w=W]
sca a86=r(mean)*svy_male_inmate86
sca list a86
sca n_86=(r(mean)*svy_male_inmate86)/(nz1_`x'*Cnt) 
sca list n_86

*Year 1991 State:  
sum cond if study==1991 [w=W]
sca a91=r(mean)*svy_male_inmate91_state
sca list a91
sca n_91_state=(r(mean)*svy_male_inmate91_state)/(nz1_`x'*Cnt)
sca list n_91_state

*Year 1991 Federal 
sum cond if study==19912 [w=W]
sca a911=r(mean)*svy_male_inmate91_fed
sca list a911
sca n_91_fed=(r(mean)*svy_male_inmate91_fed)/(nz1_`x'*Cnt) 
sca list n_91_fed

*Combine 1991 State and Federal 
sca n_91=n_91_state+n_91_fed
sca list n_91

*Average it out
sca ey10_`x'= (n_79*svy_male_inmate79 + n_86*svy_male_inmate86 + ///
  n_91_state*svy_male_inmate91_state+n_91_fed*svy_male_inmate91_fed)/svy_male_inmate_all
sca list ey10_`x'

sca drop n_79 n_86 n_91 n_91_state n_91_fed

drop cond 
 
**E[Y|Z=0,T=1]
*Let cond stands for condition
gen cond=1 if T==1 & Z==0 & `new_my'==`x' & Y==1 & Census==0
replace cond=0 if cond==. & Census==0

*Year 1979:  
sum cond if study==1979 [w=W]
sca n_79=(r(mean)*svy_male_inmate79)/(nz0_`x'*Cat) 
sca list n_79

*Year 1986:  
sum cond if study==1986 [w=W]
sca n_86=(r(mean)*svy_male_inmate86)/(nz0_`x'*Cat) 
sca list n_86

*Year 1991 State:  
sum cond if study==1991 [w=W]
sca n_91_state=(r(mean)*svy_male_inmate91_state)/(nz0_`x'*Cat)
sca list n_91_state

*Year 1991 Federal 
sum cond if study==19912 [w=W]
sca n_91_fed=(r(mean)*svy_male_inmate91_fed)/(nz0_`x'*Cat) 
sca list n_91_fed

*Combine 1991 State and Federal 
sca n_91=n_91_state+n_91_fed
sca list n_91

*Average out
sca ey01_`x'= (n_79*svy_male_inmate79 + n_86*svy_male_inmate86 + ///
  n_91_state*svy_male_inmate91_state+n_91_fed*svy_male_inmate91_fed)/svy_male_inmate_all
sca list ey01_`x'

sca drop n_79 n_86 n_91 n_91_state n_91_fed
drop cond 

**E[Y|T=0,Z=0]
*Let cond stands for condition
gen cond=1 if T==0 & Z==0 & `new_my'==`x' & Y==1 & Census==0
replace cond=0 if cond==. & Census==0

*Year 1979:  
sum cond if study==1979 [w=W]
sca n_79=(r(mean)*svy_male_inmate79)/(nz0_`x'*(Cnt+Cc)) 
sca list n_79

*Year 1986:  
sum cond if study==1986 [w=W]
sca n_86=(r(mean)*svy_male_inmate86)/(nz0_`x'*(Cnt+Cc)) 
sca list n_86

*Year 1991 State:  
sum cond if study==1991 [w=W]
sca n_91_state=(r(mean)*svy_male_inmate91_state)/(nz0_`x'*(Cnt+Cc))
sca list n_91_state

*Year 1991 Federal 
sum cond if study==19912 [w=W]
sca n_91_fed=(r(mean)*svy_male_inmate91_fed)/(nz0_`x'*(Cnt+Cc))
sca list n_91_fed

*Combine 1991 State and Federal 
sca n_91=n_91_state+n_91_fed
sca list n_91

*Average out
sca ey00_`x'=(n_79*svy_male_inmate79 + n_86*svy_male_inmate86 + ///
  n_91_state*svy_male_inmate91_state+n_91_fed*svy_male_inmate91_fed)/svy_male_inmate_all
sca list ey00_`x'

sca drop n_79 n_86 n_91 n_91_state n_91_fed
drop cond 

**E[Y|Z=1,T=1]
*Let cond stands for condition
gen cond=1 if T==1 & Z==1 & `new_my'==`x' & Y==1 & Census==0
replace cond=0 if cond==. & Census==0

*Year 1979:  
sum cond if study==1979 [w=W]
sca n_79=(r(mean)*svy_male_inmate79)/(nz1_`x'*(Cat+Cc)) 
sca list n_79

*Year 1986:  
sum cond if study==1986 [w=W]
sca n_86=(r(mean)*svy_male_inmate86)/(nz1_`x'*(Cat+Cc))  
sca list n_86

*Year 1991 State:  
sum cond if study==1991 [w=W]
sca n_91_state=(r(mean)*svy_male_inmate91_state)/(nz1_`x'*(Cat+Cc)) 
sca list n_91_state

*Year 1991 Federal 
sum cond if study==19912 [w=W]
sca n_91_fed=(r(mean)*svy_male_inmate91_fed)/(nz1_`x'*(Cat+Cc)) 
sca list n_91_fed

*Combine 1991 State and Federal 
sca n_91=n_91_state+n_91_fed
sca list n_91

*Average out
sca ey11_`x'=(n_79*svy_male_inmate79 + n_86*svy_male_inmate86 + ///
  n_91_state*svy_male_inmate91_state+n_91_fed*svy_male_inmate91_fed)/svy_male_inmate_all
sca list ey11_`x'

sca drop n_79 n_86 n_91 n_91_state n_91_fed
drop cond 


**E[Y|T=1]
*Let cond stands for condition
gen cond=1 if T==1 & Y==1 & `new_my'==`x' & Census==0
replace cond=0 if cond==. & Census==0

*Year 1979:  
sum cond if study==1979 [w=W]
sca n_79=(r(mean)*svy_male_inmate79)/((nz0_`x'+nz1_`x')*PrT1)
sca list n_79

*Year 1986:  
sum cond if study==1986 [w=W]
sca n_86=(r(mean)*svy_male_inmate86)/((nz0_`x'+nz1_`x')*PrT1) 
sca list n_86

*Year 1991 State:  
sum cond if study==1991 [w=W]
sca n_91_state=(r(mean)*svy_male_inmate91_state)/((nz0_`x'+nz1_`x')*PrT1) 
sca list n_91_state

*Year 1991 Federal 
sum cond if study==19912 [w=W]
sca n_91_fed=(r(mean)*svy_male_inmate91_fed)/((nz0_`x'+nz1_`x')*PrT1)
sca list n_91_fed

*Combine 1991 State and Federal 
sca n_91=n_91_state+n_91_fed
sca list n_91

*Average out
sca eyt1_`x'= (n_79*svy_male_inmate79 + n_86*svy_male_inmate86 + ///
  n_91_state*svy_male_inmate91_state+n_91_fed*svy_male_inmate91_fed)/svy_male_inmate_all
sca list eyt1_`x'

sca drop n_79 n_86 n_91 n_91_state n_91_fed
drop cond 

**E[Y|T=0]
*Let cond stands for condition
gen cond=1 if T==0 & Y==1 & `new_my'==`x' & Census==0
replace cond=0 if cond==.  & Census==0

*Year 1979:  
sum cond if study==1979 [w=W]
sca n_79=(r(mean)*svy_male_inmate79)/((nz0_`x'+nz1_`x')*PrT0)
sca list n_79

*Year 1986:  
sum cond if study==1986 [w=W]
sca n_86=(r(mean)*svy_male_inmate86)/((nz0_`x'+nz1_`x')*PrT0)
sca list n_86

*Year 1991 State:  
sum cond if study==1991 [w=W]
sca n_91_state=(r(mean)*svy_male_inmate91_state)/((nz0_`x'+nz1_`x')*PrT0)
sca list n_91_state

*Year 1991 Federal 
sum cond if study==19912 [w=W]
sca n_91_fed=(r(mean)*svy_male_inmate91_fed)/((nz0_`x'+nz1_`x')*PrT0)
sca list n_91_fed

*Combine 1991 State and Federal 
sca n_91=n_91_state+n_91_fed
sca list n_91

*Average out
sca eyt0_`x'= (n_79*svy_male_inmate79 + n_86*svy_male_inmate86 + ///
  n_91_state*svy_male_inmate91_state+n_91_fed*svy_male_inmate91_fed)/svy_male_inmate_all
sca list eyt0_`x'

sca drop n_79 n_86 n_91 n_91_state n_91_fed
drop cond 

**E[Y|Z=0]
*Let cond stands for condition
gen cond=1 if Z==0 & Y==1 & `new_my'==`x' & Census==0
replace cond=0 if cond==. & Census==0

*Year 1979:  
sum cond if study==1979 [w=W]
sca n_79=(r(mean)*svy_male_inmate79)/nz0_`x'
sca list n_79

*Year 1986:  
sum cond if study==1986 [w=W]
sca n_86=(r(mean)*svy_male_inmate86)/nz0_`x'
sca list n_86

*Year 1991 State:  
sum cond if study==1991 [w=W]
sca n_91_state=(r(mean)*svy_male_inmate91_state)/nz0_`x'
sca list n_91_state

*Year 1991 Federal 
sum cond if study==19912 [w=W]
sca n_91_fed=(r(mean)*svy_male_inmate91_fed)/nz0_`x'
sca list n_91_fed

*Combine 1991 State and Federal 
sca n_91=n_91_state+n_91_fed
sca list n_91

*Average out
sca eyz0_`x'=(n_79*svy_male_inmate79 + n_86*svy_male_inmate86 + ///
  n_91_state*svy_male_inmate91_state+n_91_fed*svy_male_inmate91_fed)/svy_male_inmate_all
sca list eyz0_`x'

sca drop n_79 n_86 n_91 n_91_state n_91_fed
drop cond 

**E[Y|Z=1]
*Let cond stands for condition
gen cond=1 if Z==1 & Y==1 & `new_my'==`x' & Census==0
replace cond=0 if cond==.  & Census==0

*Year 1979:  
sum cond if study==1979 [w=W]
sca n_79=(r(mean)*svy_male_inmate79)/nz1_`x'
sca list n_79

*Year 1986:  
sum cond if study==1986 [w=W]
sca n_86=(r(mean)*svy_male_inmate86)/nz1_`x'
sca list n_86

*Year 1991 State:  
sum cond if study==1991 [w=W]
sca n_91_state=(r(mean)*svy_male_inmate91_state)/nz1_`x'
sca list n_91_state

*Year 1991 Federal 
sum cond if study==19912 [w=W]
sca n_91_fed=(r(mean)*svy_male_inmate91_fed)/nz1_`x'
sca list n_91_fed

*Combine 1991 State and Federal 
sca n_91=n_91_state+n_91_fed
sca list n_91

*Average out
sca eyz1_`x'= (n_79*svy_male_inmate79 + n_86*svy_male_inmate86 + ///
  n_91_state*svy_male_inmate91_state+n_91_fed*svy_male_inmate91_fed)/svy_male_inmate_all
sca list eyz1_`x'

sca drop n_79 n_86 n_91 n_91_state n_91_fed
drop cond 

**Mean effects 
*E[Y|Z=1]-E[Y|Z=0] 
sca itt_`x'=eyz1_`x'-eyz0_`x'
sca list itt_`x' 

*2sls 
sca tsls_`x'=itt_`x'/Cc 
sca list tsls_`x'

*Testable Implications 
sca ti1_`x'=ey10_`x'-ey11_`x'
sca list ti1_`x'
sca ti2_`x'=ey10_`x'-ey00_`x'
sca list ti2_`x' 
sca ti3_`x'=ey10_`x'-ey01_`x'
sca list ti3_`x' 

**Some other estimands
*E[Y^Z(1)|nt]
sca eynt1_`x'=ey10_`x'
sca list eynt1_`x'

*E[Y^Z(0)|at]
sca eyat0_`x'=ey01_`x'
sca list eyat0_`x'

*P1: Lower bound for E[Y^Z(0)|nt] 
sca l0nt1_`x'=0

**P1: Upper bound for E[Y^Z(0)|nt] 
*Let cond stands for condition
gen cond=1 if T==0 & Z==0 & `new_my'==`x' & Y==1 & Census==0
replace cond=0 if cond==. & Census==0

*Year 1979:  
sum cond if study==1979 [w=W]
sca n_79=(r(mean)*svy_male_inmate79)/(nz0_`x'*Cnt) 
sca list n_79

*Year 1986:  
sum cond if study==1986 [w=W]
sca n_86=(r(mean)*svy_male_inmate86)/(nz0_`x'*Cnt) 
sca list n_86

*Year 1991 State:  
sum cond if study==1991 [w=W]
sca n_91_state=(r(mean)*svy_male_inmate91_state)/(nz0_`x'*Cnt)
sca list n_91_state

*Year 1991 Federal 
sum cond if study==19912 [w=W]
sca n_91_fed=(r(mean)*svy_male_inmate91_fed)/(nz0_`x'*Cnt) 
sca list n_91_fed

*Combine 1991 State and Federal 
sca n_91=n_91_state+n_91_fed
sca list n_91

*Average it out
sca u0nt1_`x'= (n_79*svy_male_inmate79 + n_86*svy_male_inmate86 + ///
  n_91_state*svy_male_inmate91_state+n_91_fed*svy_male_inmate91_fed)/svy_male_inmate_all
sca list u0nt1_`x'	

sca drop n_79 n_86 n_91 n_91_state n_91_fed

drop cond 

**P1: Lower bound for E[Y^Z(1)|at]
sca l1at1_`x'=0

*P1: Upper bound for E[Y^Z(1)|at] 
*Let cond stands for condition
gen cond=1 if T==1 & Z==1 & `new_my'==`x' & Y==1 & Census==0
replace cond=0 if cond==. & Census==0

*Year 1979:  
sum cond if study==1979 [w=W]
sca n_79=(r(mean)*svy_male_inmate79)/(nz1_`x'*Cat) 
sca list n_79

*Year 1986:  
sum cond if study==1986 [w=W]
sca n_86=(r(mean)*svy_male_inmate86)/(nz1_`x'*Cat) 
sca list n_86

*Year 1991 State:  
sum cond if study==1991 [w=W]
sca n_91_state=(r(mean)*svy_male_inmate91_state)/(nz1_`x'*Cat)
sca list n_91_state

*Year 1991 Federal 
sum cond if study==19912 [w=W]
sca n_91_fed=(r(mean)*svy_male_inmate91_fed)/(nz1_`x'*Cat) 
sca list n_91_fed

*Combine 1991 State and Federal 
sca n_91=n_91_state+n_91_fed
sca list n_91

*Average it out
sca u1at1_`x'= (n_79*svy_male_inmate79 + n_86*svy_male_inmate86 + ///
  n_91_state*svy_male_inmate91_state+n_91_fed*svy_male_inmate91_fed)/svy_male_inmate_all
sca list u1at1_`x'	

sca drop n_79 n_86 n_91 n_91_state n_91_fed

drop cond 

**P1: LNATE_nt
*Lower bounds
sca llnate_nt1_`x'=eynt1_`x'-u0nt1_`x'
sca list llnate_nt1_`x'
*Upper bounds 
sca ulnate_nt1_`x'=eynt1_`x'-l0nt1_`x'
sca list ulnate_nt1_`x'

**P1: LNATE_at
*Lower bounds
sca llnate_at1_`x'=l1at1_`x'-eyat0_`x'
sca list llnate_at1_`x'
*Upper bounds 
sca ulnate_at1_`x'=u1at1_`x'-eyat0_`x'
sca list ulnate_at1_`x' 

**P1: ATE
*Lower bounds
sca LB_Delta1_`x'=PrZ0*(p10*(ey01_`x'-yu_white$race) +p00*(yl_white$race-ey00_`x'))+PrZ1*(p11*(ey11_`x'-yu_white$race) +p01*(yl_white$race-ey10_`x'))
sca li LB_Delta1_`x'
*Upper bounds
sca UB_Delta1_`x'=PrZ0*(p10*(ey01_`x'-yl_white$race) +p00*(yu_white$race-ey00_`x'))+PrZ1*(p11*(ey11_`x'-yl_white$race) +p01*(yu_white$race-ey10_`x'))
sca li UB_Delta1_`x'

**P1: ATT 
*Lower bounds 
sca LB_Gamma1_`x'=eyt1_`x'-yu_white$race
sca li LB_Gamma1_`x'
*Upper bounds
sca UB_Gamma1_`x'=eyt1_`x'-yl_white$race 
sca li UB_Gamma1_`x'

**P1: ATE: never-takers 
*Lower bounds 
sca LB_Delta_nt1_`x'=PrZ0*(yl_white$race -u0nt1_`x')+PrZ1*(yl_white$race -ey10_`x')
sca li LB_Delta_nt1_`x' 
*Upper bounds 
sca UB_Delta_nt1_`x'=PrZ0*(yu_white$race -l0nt1_`x')+PrZ1*(yu_white$race -ey10_`x')
sca li UB_Delta_nt1_`x'

**P1: ATE: always-takers 
*Lower bounds 
sca LB_Delta_at1_`x'=PrZ0*(ey01_`x'-yu_white$race) +PrZ1*(l1at1_`x'-yu_white$race)
sca li LB_Delta_at1_`x' 
*Upper bounds 
sca UB_Delta_at1_`x'=PrZ0*(ey01_`x'-yl_white$race) +PrZ1*(u1at1_`x'-yl_white$race)
sca li UB_Delta_at1_`x'

**P2: Lower bound for E[Y^Z(0)|nt] 
sca l0nt2_`x'=l0nt1_`x'
sca list l0nt2_`x'

**P2: Upper bound for E[Y^Z(0)|nt] 
sca u0nt21_`x'=u0nt1_`x'
sca u0nt22_`x'=eynt1_`x'

sca u0nt2_`x'=min(u0nt21_`x',u0nt22_`x')
sca list u0nt2_`x'

**P2: Lower bound for E[Y^Z(1)|at]
sca l1at21_`x'=l1at1_`x' 
sca l1at22_`x'=eyat0_`x'

sca l1at2_`x'=max(l1at21_`x', l1at22_`x')
sca list l1at2_`x'

**P2: Upper bound for E[Y^Z(1)|at] 
sca u1at2_`x'=u1at1_`x'
sca list u1at2_`x'

**P2: Lower bound for E[Y^Z(0)|c], E[Y(1,T(0))|c] and E[Y^Z(1)|c]
sca l0c2_`x'=0 
sca l1c21_`x'=0
sca l1c22_`x'=l0c2_`x'
sca l10c2_`x'=l0c2_`x'

**P2: Upper bound for E[Y^Z(0)|c], E[Y(1,T(0))|c] and E[Y^Z(1)]
**P2: E[Y^Z(1)|c] Upper Bound 
*Let cond stands for condition
gen cond=1 if T==1 & Z==1 & `new_my'==`x' & Y==1 & Census==0
replace cond=0 if cond==. & Census==0

*Year 1979:  
sum cond if study==1979 [w=W]
sca n_79=(r(mean)*svy_male_inmate79)/(nz1_`x'*Cc) 
sca list n_79

*Year 1986:  
sum cond if study==1986 [w=W]
sca n_86=(r(mean)*svy_male_inmate86)/(nz1_`x'*Cc) 
sca list n_86

*Year 1991 State:  
sum cond if study==1991 [w=W]
sca n_91_state=(r(mean)*svy_male_inmate91_state)/(nz1_`x'*Cc)
sca list n_91_state

*Year 1991 Federal 
sum cond if study==19912 [w=W]
sca n_91_fed=(r(mean)*svy_male_inmate91_fed)/(nz1_`x'*Cc) 
sca list n_91_fed

*Combine 1991 State and Federal 
sca n_91=n_91_state+n_91_fed
sca list n_91

*Average it out
sca u1c2_`x'= (n_79*svy_male_inmate79 + n_86*svy_male_inmate86 + ///
  n_91_state*svy_male_inmate91_state+n_91_fed*svy_male_inmate91_fed)/svy_male_inmate_all
sca list u1c2_`x'

sca drop n_79 n_86 n_91 n_91_state n_91_fed

drop cond 

**P2: E[Y^Z(0)|c] Upper Bound 
*Let cond stands for condition
gen cond=1 if T==0 & Z==0 & `new_my'==`x' & Y==1 & Census==0
replace cond=0 if cond==. & Census==0

*Year 1979:  
sum cond if study==1979 [w=W]
sca n_79=(r(mean)*svy_male_inmate79)/(nz0_`x'*Cc) 
sca list n_79

*Year 1986:  
sum cond if study==1986 [w=W]
sca n_86=(r(mean)*svy_male_inmate86)/(nz0_`x'*Cc) 
sca list n_86

*Year 1991 State:  
sum cond if study==1991 [w=W]
sca n_91_state=(r(mean)*svy_male_inmate91_state)/(nz0_`x'*Cc)
sca list n_91_state

*Year 1991 Federal 
sum cond if study==19912 [w=W]
sca n_91_fed=(r(mean)*svy_male_inmate91_fed)/(nz0_`x'*Cc) 
sca list n_91_fed

*Combine 1991 State and Federal 
sca n_91=n_91_state+n_91_fed
sca list n_91

*Average it out
sca u0c21_`x'= (n_79*svy_male_inmate79 + n_86*svy_male_inmate86 + ///
  n_91_state*svy_male_inmate91_state+n_91_fed*svy_male_inmate91_fed)/svy_male_inmate_all
sca list u0c21_`x'		

sca u0c22_`x'=u1c2_`x'
sca list u0c22_`x'

sca drop n_79 n_86 n_91 n_91_state n_91_fed

drop cond 

**E[Y(1,T(0))|c] Upper bound
sca u10c2_`x'=u1c2_`x'
sca list u10c2_`x'

**P2: LNATE_nt
*Lower bounds
sca llnate_nt21_`x'=eynt1_`x'-u0nt1_`x'
sca llnate_nt22_`x'=0
sca llnate_nt2_`x'=max(0, llnate_nt21_`x')
sca list llnate_nt2_`x'
*Upper bounds 
sca ulnate_nt2_`x'=eynt1_`x'-l0nt1_`x'
sca list ulnate_nt2_`x'

**P2: LNATE_at
*Lower bounds
sca llnate_at21_`x'=l1at1_`x'-eyat0_`x'
sca llnate_at22_`x'=0
sca llnate_at2_`x'=max(0, llnate_at21_`x')
sca list llnate_at2_`x'
*Upper bounds 
sca ulnate_at2_`x'=u1at1_`x'-eyat0_`x'
sca list ulnate_at2_`x'

**P2: LNATE_c0
*Lower bounds 
sca llnate_c02_`x'=0
sca list llnate_c02_`x'
*Upper bounds 
sca ulnate_c02_`x'=u1c2_`x'-l0c2_`x'
sca list ulnate_c02_`x'

**P2: LNATE_c1
*Lower bounds 
sca llnate_c12_`x'=0
sca list llnate_c12_`x'
*Upper bounds 
sca ulnate_c12_`x'=u1c2_`x'-l0c2_`x'
sca list ulnate_c12_`x'

**P2: LMATE_c0
*Lower bounds 
sca llmate_c0_`x'=0
sca list llmate_c0_`x'
*Upper bounds 
sca ulmate_c0_`x'=u1c2_`x'-l0c2_`x'
sca list ulmate_c0_`x' 

**P2: LMATE_c1
*Lower bounds 
sca llmate_c1_`x'=0
sca list llmate_c1_`x'
*Upper bounds 
sca ulmate_c1_`x'=u1c2_`x'-l0c2_`x'
sca list ulmate_c1_`x' 

**P2: E[Y(1,1)|nt]
*Lower bounds 
sca ley11nt2_`x'=ey10_`x'
sca li ley11nt2_`x'
*Upper bounds 
sca uey11nt2_`x'=yu_white$race
sca li uey11nt2_`x'

**P2: E[Y(1,1)|nt]-E[Y(1)|nt]
*Lower bounds 
sca LB_Delta1_nt_`x'=0
sca li LB_Delta1_nt_`x'
*Upper bounds 
sca UB_Delta1_nt_`x'=yu_white$race-ey10_`x'
sca li UB_Delta1_nt_`x'

**P2: E[Y(0,1)|nt]
*Lower bounds 
sca ley01nt2_`x'=l0nt1_`x'
sca li ley01nt2_`x'
*Upper bounds 
sca uey01nt2_`x'=yu_white$race
sca li uey01nt2_`x'

**P2: E[Y(0,1)|nt]-E[Y(0)|nt]
*Lower bounds 
sca LB_Delta0_nt_`x'=0 
sca li LB_Delta0_nt_`x'
*Upper bounds 
sca UB_Delta0_nt_`x'=yu_white$race-l0nt1_`x'
sca li UB_Delta0_nt_`x'

**P2: E[Y(1,0)|at]
*Lower bounds 
sca ley10at2_`x'=yl_white$race
sca li ley10at2_`x'
*Upper bounds 
sca uey10at2_`x'=u1at1_`x'
sca li uey10at2_`x'

**P2: E[Y(1)|at]-E[Y(1,0)|at]
*Lower bounds 
sca LB_Delta1_at_`x'=0 
sca li LB_Delta1_at_`x'
*Upper bounds 
sca UB_Delta1_at_`x'=u1at1_`x'-yl_white$race
sca li UB_Delta1_at_`x'

**P2: E[Y(0,0)|at]
*Lower bounds 
sca ley00at2_`x'=yl_white$race
sca li ley00at2_`x'
*Upper bounds 
sca uey00at2_`x'=ey01_`x'
sca li uey00at2_`x'

**P2: E[Y(0)|at]-E[Y(0,0)|at]
*Lower bounds 
sca LB_Delta0_at_`x'=0 
sca li LB_Delta0_at_`x'
*Upper bounds 
sca UB_Delta0_at_`x'=ey01_`x'-yl_white$race
sca li UB_Delta0_at_`x'

**P2: ATE: never-takers 
*Lower bounds 
sca LB_Delta_nt2_`x'=PrZ0*LB_Delta0_nt_`x'+PrZ1*LB_Delta1_nt_`x'
sca li LB_Delta_nt2_`x' 
*Upper bounds 
sca UB_Delta_nt2_`x'=PrZ0*UB_Delta0_nt_`x'+PrZ1*UB_Delta1_nt_`x'
sca li UB_Delta_nt2_`x'

**P2: ATE: always-takers 
*Lower bounds 
sca LB_Delta_at2_`x'=PrZ0*LB_Delta0_at_`x'+PrZ1*LB_Delta1_at_`x'
sca li LB_Delta_at2_`x' 
*Upper bounds 
sca UB_Delta_at2_`x'=PrZ0*UB_Delta0_at_`x'+PrZ1*UB_Delta1_at_`x'
sca li UB_Delta_at2_`x'

*ATT 
sca LB_Gamma2_`x'=0
sca li LB_Gamma2_`x'
sca UB_Gamma21_`x'=eyt1_`x'-(PrZ1/PrT1)*(p00*ey00_`x'-p01*ey10_`x')-(p10/PrT1)*yl_white$race 
sca UB_Gamma22_`x'=eyt1_`x'-(PrZ1/PrT1)*(p11-p10)*l0c2_`x'-(p10/PrT1)*yl_white$race
sca li UB_Gamma21_`x'
sca li UB_Gamma22_`x'

**P2: MATE 
*Lower bound for MATE
sca lm2_`x'=0
*Upper bound for MATE 
sca um21_`x'=eyz1_`x'-eyz0_`x'-Cat*0-Cnt*0
sca um22_`x'=eyz1_`x'-eyz0_`x'-Cat*llnate_at21_`x'-Cnt*0
sca um23_`x'=eyz1_`x'-eyz0_`x'-Cat*0-Cnt*llnate_nt21_`x' 
sca um24_`x'=eyz1_`x'-eyz0_`x'-Cat*llnate_at21_`x'-Cnt*llnate_nt21_`x' 
sca list um21_`x' 
sca list um22_`x'
sca list um23_`x'
sca list um24_`x' 
sca um2_`x'=min(um21_`x', um22_`x', um23_`x', um24_`x')
sca li um2_`x'

**P2: NATE 
*Lower bound for NATE 
sca ln21_`x'=eyz1_`x'-eyz0_`x'-um21_`x'
sca ln22_`x'=eyz1_`x'-eyz0_`x'-um22_`x'
sca ln23_`x'=eyz1_`x'-eyz0_`x'-um23_`x'
sca ln24_`x'=eyz1_`x'-eyz0_`x'-um24_`x'
sca ln2_`x'=max(ln21_`x', ln22_`x', ln23_`x', ln24_`x')
*Upper bound for NATE
sca un2_`x'=eyz1_`x'-eyz0_`x'

sca list ln21_`x'
sca list ln22_`x'
sca list ln23_`x'
sca list ln24_`x'
sca list un2_`x'

**P2: LATE 
*Lower bound for LATE
sca ll2_`x'=0
*Upper bound for LATE 
sca ul21_`x'=(eyz1_`x'-eyz0_`x'-Cat*0-Cnt*0)/Cc
sca ul22_`x'=(eyz1_`x'-eyz0_`x'-Cat*llnate_at21_`x'-Cnt*0)/Cc
sca ul23_`x'=(eyz1_`x'-eyz0_`x'-Cat*0-Cnt*llnate_nt21_`x')/Cc 
sca ul24_`x'=(eyz1_`x'-eyz0_`x'-Cat*llnate_at21_`x'-Cnt*llnate_nt21_`x')/Cc 
sca ul2_`x'=min(ul21_`x', ul22_`x', ul23_`x', ul24_`x')
sca list ul21_`x' 
sca list ul22_`x'
sca list ul23_`x'
sca list ul24_`x' 

**P3: E[Y(0)|nt]
*Lower bound 
sca l0nt31_`x'=ey00_`x'
sca l0nt32_`x'=ey01_`x' 
 
*Upper bound 
sca u0nt3_`x'=u0nt1_`x' 
sca li u0nt3_`x'

**P3: E[Y(1)|at] 
*Lower bound 
sca l1at3_`x'=ey11_`x' 
sca li l1at3_`x'
*Upper bound 
sca u1at31_`x'=ey10_`x' 
sca u1at32_`x'=u1at1_`x'
sca li u1at31_`x'
sca li u1at32_`x' 

**P3: E[Y(0)|c] 
*Lower bound 
sca l0c3_`x'=l0c2_`x'
sca li l0c3_`x' 
*Upper bound 
sca u0c31_`x'=ey00_`x' 
sca li u0c31_`x' 
sca u0c32_`x'=ey01_`x'
sca li u0c32_`x'

**P3: E[Y(1)|c] 
*Lower bound 
sca l1c3_`x'=l1c21_`x'
sca li l1c3_`x' 
*Upper bound 
sca u1c3_`x'=ey11_`x' 
sca li u1c3_`x'

**P3: E[Y(1,D(0))|c]
*Lower bound 
sca l10c3_`x'=yl_white$race 
sca li l10c3_`x' 
*Upper bound 
sca u10c31_`x'=u1at1_`x' 
sca u10c32_`x'=ey10_`x' 
sca li u10c31_`x' 
sca li u10c32_`x'

**P3: E[Y(0,D(1))|c]
*Lower bound
sca l01c3_`x'=yl_white$race 
sca li l01c3_`x'
*Upper bound 
sca u01c3_`x'=ey01_`x' 
sca li u01c3_`x'

**P3: LNATE_nt 
*lower bound
sca llnate_nt3_`x'=llnate_nt1_`x'
sca list llnate_nt3_`x'
*upper bound
sca ulnate_nt31_`x'=ey10_`x'-ey00_`x'
sca ulnate_nt32_`x'=ey10_`x'-ey01_`x'
sca li ulnate_nt31_`x'
sca li ulnate_nt32_`x'
sca ulnate_nt3_`x'=min(ulnate_nt31_`x', ulnate_nt32_`x')
sca list ulnate_nt3_`x'

**P3: LNATE_at
*lower bound
sca llnate_at3_`x'=ey11_`x'-ey01_`x'
sca list llnate_at3_`x'
*upper bound
sca ulnate_at31_`x'=u1at1_`x'-ey01_`x'
sca ulnate_at32_`x'=ey10_`x'-ey01_`x'
sca list ulnate_at31_`x'
sca list ulnate_at32_`x'
sca ulnate_at3_`x'=min(ulnate_at31_`x',ulnate_at32_`x')
sca li ulnate_at3_`x'

**P3: LNATE_c0
*lower bound
sca llnate_c031_`x'=yl_white$race-ey00_`x'
sca llnate_c032_`x'=yl_white$race-ey01_`x'
sca li llnate_c031_`x'
sca li llnate_c032_`x'
sca llnate_c03_`x'=max(llnate_c031_`x', llnate_c032_`x')
sca li llnate_c03_`x'
*upper bound
sca ulnate_c031_`x'=u1at1_`x'-l0c2_`x'
sca ulnate_c032_`x'=ey10_`x'-l0c2_`x'
sca ulnate_c03_`x'=min(ulnate_c031_`x', ulnate_c032_`x')
sca li ulnate_c031_`x'
sca li ulnate_c032_`x'

**P3: LNATE_c1 
*Lower bound 
sca llnate_c13_`x'=l1c21_`x'-ey01_`x'
sca li llnate_c13_`x' 
*Upper bound 
sca ulnate_c13_`x'=ey11_`x'-yl_white$race
sca li ulnate_c13_`x'

**P3: LMATE_c1 
*Lower bound 
sca llmate_c131_`x'=l1c21_`x'-ey10_`x'
sca llmate_c132_`x'=l1c21_`x'-u1at1_`x' 
sca li llmate_c131_`x'
sca li llmate_c132_`x'
*Upper bound 
sca ulmate_c13_`x'=ey11_`x'-yl_white$race 
sca li ulmate_c13_`x'

**P3: LMATE_c0 
*Lower bound 
sca llmate_c031_`x'=yl_white$race-ey00_`x' 
sca llmate_c032_`x'=yl_white$race-ey01_`x' 
sca li llmate_c031_`x'
sca li llmate_c032_`x'
*Upper bound 
sca ulmate_c03_`x'=ey01_`x'-l0c2_`x' 
sca li ulmate_c03_`x'

**E[Y(1,1)|nt] 
*Lower bound 
sca ley11nt3_`x'=ey11_`x'
sca li ley11nt3_`x'
*Upper bound 
sca uey11nt3_`x'=yu_white$race
sca li uey11nt3_`x'

**Delta(1)_nt 
*Lower bound 
sca LB_Delta1_nt3_`x'=ey11_`x'-ey10_`x' 
sca li LB_Delta1_nt3_`x' 
*Upper bound 
sca UB_Delta1_nt3_`x'=yu_white$race-ey10_`x'
sca li UB_Delta1_nt3_`x'

**E[Y(0,1)|nt]
*Lower bound 
sca ley01nt3_`x'=ey01_`x'
sca li ley01nt3_`x'
*Upper bound 
sca uey01nt3_`x'=yu_white$race
sca li uey01nt3_`x'

**Delta(0)_nt 
*Lower bound 
sca LB_Delta0_nt3_`x'=ey01_`x'-u0nt1_`x'
sca li LB_Delta0_nt3_`x'
*Upper bound 
sca UB_Delta0_nt31_`x'=yu_white$race-ey01_`x'
sca UB_Delta0_nt32_`x'=yu_white$race-ey00_`x'
sca li UB_Delta0_nt31_`x' 
sca li UB_Delta0_nt32_`x'

**P3: Delta_nt 
*Lower bound 
sca LB_Delta_nt3_`x'=PrZ0*(LB_Delta0_nt3_`x')+PrZ1*(LB_Delta1_nt3_`x')
sca li LB_Delta_nt3_`x'
*Upper bound 
sca UB_Delta_nt31_`x'=PrZ0*(UB_Delta0_nt31_`x')+PrZ1*(UB_Delta1_nt3_`x')
sca UB_Delta_nt32_`x'=PrZ0*(UB_Delta0_nt32_`x')+PrZ1*(UB_Delta1_nt3_`x')
sca li UB_Delta_nt31_`x' 
sca li UB_Delta_nt32_`x'

**E[Y(1,0)|at]
*Lower bound 
sca ley10at3_`x'=yl_white$race 
sca li ley10at3_`x'
*Upper bound
sca uey10at3_`x'=ey10_`x'
sca li uey10at3_`x'

**Delta(1)_at 
*Lower bound 
sca LB_Delta1_at3_`x'=ey11_`x'-ey10_`x' 
sca li LB_Delta1_at3_`x'
*Upper bound 
sca UB_Delta1_at31_`x'=ey10_`x'-yl_white$race
sca li  UB_Delta1_at31_`x' 
sca UB_Delta1_at32_`x'=u1at1_`x'-yl_white$race
sca li UB_Delta1_at32_`x' 

**E[Y(0,0)|at]
*Lower bound 
sca ley00at3_`x'=l0c2_`x' 
sca li ley00at3_`x' 
*Upper bound 
sca uey00at3_`x'=u0nt1_`x' 
sca li uey00at3_`x' 

**Delta(0)_at 
*Lower bound 
sca LB_Delta0_at3_`x'=ey01_`x'-u0nt1_`x' 
sca li LB_Delta0_at3_`x'
*Upper bound 
sca UB_Delta0_at3_`x'=ey01_`x'-l0c2_`x' 
sca li UB_Delta0_at3_`x'

**P3: Delta(z)_at 
*Lower bound 
sca LB_Delta_at3_`x'=PrZ1*LB_Delta1_at3_`x'+PrZ0*LB_Delta0_at3_`x'
sca li LB_Delta_at3_`x'
*Upper bound 
sca UB_Delta_at31_`x'=PrZ1*UB_Delta1_at31_`x'+PrZ0*UB_Delta0_at3_`x'
sca UB_Delta_at32_`x'=PrZ1*UB_Delta1_at32_`x'+PrZ0*UB_Delta0_at3_`x'
sca li UB_Delta_at31_`x' 
sca li UB_Delta_at32_`x'


**ATT
*Lower bound 
sca LB_Gamma31_`x'=eyt1_`x'-(PrZ1/PrT1)*(p10*ey10_`x'+(p11-p10)*u1at1_`x')-(PrZ0/PrT1)*p10*u0nt1_`x'
sca LB_Gamma32_`x'=eyt1_`x'-(PrZ1/PrT1)*(p10*ey10_`x'+(p11-p10)*ey10_`x')-(PrZ0/PrT1)*p10*u0nt1_`x'
sca li LB_Gamma31_`x'
sca li LB_Gamma32_`x'
*Upper bound 
sca UB_Gamma31_`x'= eyt1_`x'-(PrZ1/PrT1)*p00*ey00_`x'-(PrZ1/PrT1)*p11*yl_white$race+(PrZ1/PrT1)*p01*u0nt1_`x' ///
+(PrZ1/PrT1)*(p11-p10)*ey00_`x'-(PrZ0/PrT1)*p10*l0c2_`x' 
sca UB_Gamma32_`x'= eyt1_`x'-(PrZ1/PrT1)*p00*ey00_`x'-(PrZ1/PrT1)*p11*yl_white$race+(PrZ1/PrT1)*p01*u0nt1_`x' ///
+(PrZ1/PrT1)*(p11-p10)*ey01_`x'-(PrZ0/PrT1)*p10*l0c2_`x' 
sca li UB_Gamma31_`x' 
sca li UB_Gamma32_`x'

**P3: MATE
*lower bound for MATE1
sca lmate1_31_`x'=eyz1_`x'-Cat*u1at1_`x'-Cnt*ey10_`x'-Cc*u1at1_`x'
sca lmate1_32_`x'=eyz1_`x'-Cat*u1at1_`x'-Cnt*ey10_`x'-Cc*ey10_`x'
sca lmate1_33_`x'=eyz1_`x'-Cat*ey10_`x'-Cnt*ey10_`x'-Cc*u1at1_`x' 
sca lmate1_34_`x'=eyz1_`x'-Cat*ey10_`x'-Cnt*ey10_`x'-Cc*ey10_`x'

*lower bound for MATE0 under delta0_1
sca lmate0_31_`x'=Cc*(yl_white$race-ey00_`x')
sca lmate0_32_`x'=Cc*(yl_white$race-ey01_`x')
*lower bound for MATE0 under delta0_3
sca lmate0_33_`x'=Cat*ey01_`x'+Cnt*ey00_`x'+Cc*yl_white$race-eyz0_`x'
sca lmate0_34_`x'=Cat*ey01_`x'+Cnt*ey01_`x'+Cc*yl_white$race-eyz0_`x'

*lower bound for MATEz
local i=1
forvalues y=1(1)4 {
   forvalues z=1(1)4 {
   
   sca lmate3_`i'_`x'=PrZ1*lmate1_3`y'_`x'+PrZ0*lmate0_3`z'_`x'
   local i=`i'+1
   
   }
}

*upper bound for MATEz
sca umate3_`x'=PrZ1*Cc*(ey11_`x'-yl_white$race)+PrZ0*Cc*(ey01_`x'-l0c2_`x')
sca list umate3_`x'

**P3: NATE
*lower bound
sca lnate3_`x'=eyz1_`x'-eyz0_`x'-umate3_`x' 
sca list lnate3_`x'

*upper bound
local i=1
forvalues y=1(1)4 {
   forvalues z=1(1)4 {

  sca unate3_`i'_`x'=eyz1_`x'-eyz0_`x'-PrZ1*lmate0_3`z'_`x'+PrZ0*lmate1_3`y'_`x'
  local i=`i'+1
  
    }
}	
  
**P3: LATE
*lower bound
forvalues i=1(1)16 {
sca llate3_`i'_`x'=lmate3_`i'_`x'/Cc
}
*upper bound 
sca ulate3_`x'=umate3_`x'/Cc

**P4: E[Y(0)|nt]: 
*lower bound
sca l0nt41_`x'=ey00_`x'
sca l0nt42_`x'=ey01_`x'
sca li l0nt41_`x'
sca li l0nt42_`x'
*upper bound 
sca u0nt41_`x'=ey10_`x'
sca u0nt42_`x'=u0nt1_`x'
sca li u0nt41_`x'
sca li u0nt42_`x'

**P4: E[Y(1)|at]: 
*lower bound
sca l1at41_`x'=ey11_`x'
sca l1at42_`x'=ey01_`x'
sca li l1at41_`x'
sca li l1at42_`x'
*upper bound 
sca u1at41_`x'=ey10_`x'
sca u1at42_`x'=u1at1_`x'
sca li u1at41_`x'
sca li u1at42_`x'

**P4: E[Y(0)|c]: 
*lower bound 
sca l0c41_`x'=l0c2_`x'
sca li l0c41_`x'
*upper bound 
sca u0c41_`x'=ey11_`x' 
sca u0c42_`x'=ey00_`x'
sca u0c43_`x'=ey01_`x'
sca li u0c41_`x'
sca li u0c42_`x'
sca li u0c43_`x'

**P4: E[Y(1)|c]
*lower bound 
sca l1c41_`x'=l0c2_`x' 
sca l1c42_`x'=l1c21_`x' 
sca li l1c41_`x'
sca li l1c42_`x'
*upper bound 
sca u1c4_`x'=ey11_`x' 
sca li u1c4_`x'

**P4: E[Y(1,D_0)|c]
*Lower bound
sca l10c41_`x'=l0c2_`x' 
sca li l10c41_`x'
*Upper bound 
sca u10c41_`x'=ey11_`x' 
sca li u10c41_`x'

**P4: E[Y(0,D_1)|c]
*Lower bound 
sca l01c41_`x'=l0c2_`x' 
sca li l01c41_`x' 
*Upper bound 
sca u01c41_`x'=ey11_`x' 
sca li u01c41_`x' 
sca u01c42_`x'=ey01_`x' 
sca li u01c42_`x'

**P4: LNATE_nt_z
*lower bound
sca llnate_nt41_`x'=0
sca llnate_nt42_`x'=llnate_nt1_`x'
sca list llnate_nt41_`x'
sca list llnate_nt42_`x'
sca llnate_nt4_`x'=max(llnate_nt41_`x', llnate_nt42_`x')
sca li llnate_nt4_`x'
*upper bound
sca ulnate_nt41_`x'=ey10_`x'-ey00_`x'
sca ulnate_nt42_`x'=ey10_`x'-ey01_`x'
sca li ulnate_nt41_`x'
sca li ulnate_nt42_`x' 
sca ulnate_nt4_`x'=min(ulnate_nt41_`x', ulnate_nt42_`x')
sca li ulnate_nt4_`x' 

**P4: LNATE_at(z)
*lower bound
sca llnate_at41_`x'=0
sca llnate_at42_`x'=ey11_`x'-ey01_`x' 

sca list llnate_at41_`x'
sca list llnate_at42_`x'

sca llnate_at4_`x'=max(llnate_at41_`x', llnate_at42_`x')
sca li llnate_at4_`x' 
*upper bound
sca ulnate_at41_`x' =u1at1_`x' -ey01_`x' 
sca ulnate_at42_`x' =ey10_`x' -ey01_`x' 

sca list ulnate_at41_`x'  
sca list ulnate_at42_`x' 

sca ulnate_at4_`x' =min(ulnate_at41_`x' , ulnate_at42_`x')
sca li ulnate_at4_`x' 


**P4: LNATE0_c
*lower bound
sca llnate0_c4_`x' =0
sca list llnate0_c4_`x' 
*upper bound
sca ulnate0_c4_`x' =ey11_`x' -l0c2_`x' 
sca li ulnate0_c4_`x' 

**P4: LNATE1_c
*lower bound
sca llnate1_c41_`x'=l1c21_`x'-ey01_`x'
sca llnate1_c42_`x'=0

sca li llnate1_c41_`x'
sca li llnate1_c42_`x'

sca llnate1_c4_`x'=max(llnate1_c41_`x', llnate1_c42_`x')
sca list llnate1_c4_`x'
*upper bound
sca ulnate1_c4_`x'=ey11_`x'-l0c2_`x'
sca li ulnate1_c4_`x'

**P4: LMATE1_c
*lower bound
sca llmate1_c4_`x'=0
sca list llmate1_c4_`x'
*upper bound
sca ulmate1_c4_`x'=ey11_`x'-l0c2_`x'
sca li ulmate1_c4_`x'

**P4: LMATE0_c
*lower bound
sca llmate0_c4_`x'=0
sca list llmate0_c4_`x'
*upper bound
sca ulmate0_c41_`x'=ey11_`x'-l0c2_`x'
sca ulmate0_c42_`x'=ey01_`x'-l0c2_`x'

sca li ulmate0_c41_`x'
sca li ulmate0_c42_`x'

**P4: E[Y(1,1)|nt]
*lower bound 
sca ley11nt4_`x'=ey10_`x'
sca li ley11nt4_`x'
*upper bound  
sca uey11nt4_`x'=yu_white$race
sca li uey11nt4_`x' 

**P4: E[Y(0,1)|nt]
*lower bound 
sca ley01nt41_`x'=ey00_`x' 
sca ley01nt42_`x' =ey01_`x' 
sca li ley01nt41_`x'  
sca li ley01nt42_`x' 
*upper bound 
sca uey01nt4_`x' =yu_white$race 
sca li uey01nt4_`x' 

**P4: E[Y(1,1)|nt]-E[Y(1)|nt]
*lower bound
sca LB_Delta1_nt4_`x' =0 
sca li  LB_Delta1_nt4_`x' 
*upper bound 
sca UB_Delta1_nt4_`x' =yu_white$race-ey10_`x' 
sca li  UB_Delta1_nt4_`x' 

**P4: E[Y(0,1)|nt]-E[Y(0)|nt]
*lower bound 
sca LB_Delta0_nt4_`x' =0
sca li  LB_Delta0_nt4_`x' 
*upper bound 
sca UB_Delta0_nt41_`x' =yu_white$race-ey00_`x'  
sca UB_Delta0_nt42_`x' =yu_white$race-ey01_`x'  

sca li UB_Delta0_nt41_`x' 
sca li UB_Delta0_nt42_`x' 

**P4: E[Y(1,0)|at] 
*lower bound 
sca ley10at4_`x'=l0c2_`x' 
sca li ley10at4_`x' 
*upper bound 
sca uey10at41_`x'=ey10_`x' 
sca uey10at42_`x'=u1at1_`x'
sca li uey10at41_`x' 
sca li uey10at42_`x' 

**P4: E[Y(0,0)|at] 
*lower bound 
sca ley00at4_`x'=l0c2_`x' 
sca li ley00at4_`x' 
*upper bound 
sca uey00at41_`x'=u0nt1_`x' 
sca uey00at42_`x'=ey10_`x' 
sca li uey00at41_`x'
sca li uey00at42_`x'

**P4: E[Y(1)|at]-E[Y(1,0)|at] 
*lower bound 
sca LB_Delta1_at4_`x'=0 
sca li LB_Delta1_at4_`x'
*upper bound 
sca UB_Delta1_at41_`x'=ey10_`x'-l0c2_`x'
sca UB_Delta1_at42_`x'=u1at1_`x'-l0c2_`x'

sca li UB_Delta1_at41_`x' 
sca li UB_Delta1_at42_`x'

**P4: E[Y(0)|at]-E[Y(0,0)|at]
*lower bound 
sca LB_Delta0_at4_`x'=0 
sca li LB_Delta0_at4_`x'
*upper bound 
sca UB_Delta0_at4_`x'=ey01_`x'-l0c2_`x' 
sca li UB_Delta0_at4_`x'

**P4: Delta(z)_nt 
*Lower bound 
sca LB_Delta_nt4_`x'=PrZ0*(LB_Delta0_nt4_`x')+PrZ1*(LB_Delta1_nt4_`x')
sca li LB_Delta_nt4_`x'
*Upper bound 
sca UB_Delta_nt41_`x'=PrZ0*(UB_Delta0_nt41_`x')+PrZ1*(UB_Delta1_nt4_`x')
sca UB_Delta_nt42_`x'=PrZ0*(UB_Delta0_nt42_`x')+PrZ1*(UB_Delta1_nt4_`x')
sca li UB_Delta_nt41_`x' 
sca li UB_Delta_nt42_`x'

**P4: Delta(z)_at 
*lower bound 
sca LB_Delta_at4_`x'=PrZ1*LB_Delta1_at4_`x'+PrZ0*LB_Delta0_at4_`x'
sca li LB_Delta_at4_`x' 
*upper bound 
sca UB_Delta_at41_`x'=PrZ1*UB_Delta1_at41_`x'+PrZ0*UB_Delta0_at4_`x'
sca UB_Delta_at42_`x'=PrZ1*UB_Delta1_at42_`x'+PrZ0*UB_Delta0_at4_`x'
sca li UB_Delta_at41_`x' 
sca li UB_Delta_at42_`x'

**Bounds ATT:
*Lower bound 
sca LB_ATT41_`x'=0
sca li LB_ATT41_`x'

*Upper bound 
sca UB_ATT41_`x'=eyt1_`x'-(p10/PrT1)*l0c2_`x'-(PrZ1/PrT1)*p00*ey00_`x'+(PrZ1/PrT1)*p01*ey10_`x' 
sca li UB_ATT41_`x'
sca UB_ATT42_`x'=eyt1_`x'-(p10/PrT1)*l0c2_`x'-(PrZ1/PrT1)*p00*ey00_`x'+(PrZ1/PrT1)*p01*u0nt1_`x' 
sca li UB_ATT42_`x'
sca UB_ATT43_`x'=eyt1_`x'-(PrZ1/PrT1)*(p11)*l0c2_`x'-(PrZ0/PrT1)*p10*l0c2_`x' 
sca li UB_ATT43_`x'

**P4: MATE
*lower bound
sca lmate4_`x'=0
sca list lmate4_`x'

*upper bound
*bounds under MATE1
sca umate1_41_`x'=eyz1_`x'-eyz0_`x'-Cat*ey01_`x'+Cat*ey01_`x'-Cnt*0-Cc*0
sca umate1_42_`x'=eyz1_`x'-eyz0_`x'-Cat*ey01_`x'+Cat*ey01_`x'-Cnt*(ey10_`x'-u0nt1_`x')-Cc*0
sca umate1_43_`x'=eyz1_`x'-eyz0_`x'-Cat*ey11_`x'+Cat*ey01_`x'-Cnt*0-Cc*0
sca umate1_44_`x'=eyz1_`x'-eyz0_`x'-Cat*ey11_`x'+Cat*ey01_`x'-Cnt*(ey10_`x'-u0nt1_`x')-Cc*0

sca umate0_41_`x'=eyz1_`x'-eyz0_`x'-Cat*0-Cnt*0-Cc*0
sca umate0_42_`x'=eyz1_`x'-eyz0_`x'-Cat*0-Cnt*(ey10_`x'-u0nt1_`x')-Cc*0
sca umate0_43_`x'=eyz1_`x'-eyz0_`x'-Cat*(ey11_`x'-ey01_`x') -Cnt*0-Cc*0
sca umate0_44_`x'=eyz1_`x'-eyz0_`x'-Cat*(ey11_`x'-ey01_`x') -Cnt*(ey10_`x'-u0nt1_`x')-Cc*0
sca umate0_45_`x'=eyz1_`x'-eyz0_`x'-Cat*0-Cnt*0-Cc*(l1c21_`x'-ey01_`x')
sca umate0_46_`x'=eyz1_`x'-eyz0_`x'-Cat*0-Cnt*(ey10_`x'-u0nt1_`x')-Cc*(l1c21_`x'-ey01_`x')
sca umate0_47_`x'=eyz1_`x'-eyz0_`x'-Cat*(ey11_`x'-ey01_`x') -Cnt*0-Cc*(l1c21_`x'-ey01_`x')
sca umate0_48_`x'=eyz1_`x'-eyz0_`x'-Cat*(ey11_`x'-ey01_`x') -Cnt*(ey10_`x'-u0nt1_`x')-Cc*(l1c21_`x'-ey01_`x')
sca umate0_49_`x'=Cat*ey01_`x'+Cnt*ey10_`x'+Cc*ey11_`x'-eyz0_`x'
sca umate0_410_`x'=Cat*ey01_`x'+Cnt*u0nt1_`x'+Cc*ey11_`x'-eyz0_`x'
sca umate0_411_`x'=Cat*ey01_`x'+Cnt*ey10_`x'+Cc*ey01_`x'-eyz0_`x'
sca umate0_412_`x'=Cat*ey01_`x'+Cnt*u0nt1_`x'+Cc*ey01_`x'-eyz0_`x'

*upper bound for MATEz
local i=1
forvalues y=1(1)4 {
   forvalues z=1(1)12 {
   sca umate4_`i'_`x'=PrZ1*umate1_4`y'_`x'+PrZ0*umate0_4`z'_`x'
   local i=`i'+1
   }
}

**P4: NATE
*lower bound
local i=1
forvalues y=1(1)4 {
   forvalues z=1(1)12 {
sca lnate4_`i'_`x'=eyz1_`x'-eyz0_`x'-PrZ1*umate0_4`z'_`x'-PrZ0*umate1_4`y'_`x'
 local i=`i'+1
    }
}	

*upper bound 
sca unate4_`x'=eyz1_`x'-eyz0_`x'

**P4: LATE
*lower bound
sca llate4_`x'=lmate4_`x'/Cc
   
*upper bound
forvalues i=1(1)48 {
sca ulate4_`i'_`x'=umate4_`i'_`x'/Cc
}

}	

      set more off
	  *Create a global text variable for all the bounds scaler names 
	  # delimit ;
	  global bounds=" ej ey10 ey01 ey00 ey11 eyt1 eyt0 eyz0 eyz1 itt tsls ti1 ti2  ti3 
	  eynt1 eyat0 l0nt1 u0nt1 l1at1 u1at1 llnate_nt1 ulnate_nt1 llnate_at1 ulnate_at1 LB_Delta1 
	  UB_Delta1 LB_Gamma1 UB_Gamma1 LB_Delta_nt1 UB_Delta_nt1 LB_Delta_at1 UB_Delta_at1 
	  l0nt2 u0nt21 u0nt22 u0nt2  l1at21 l1at22 l1at2 u1at2 l0c2 l1c21 l1c22 l10c2 u1c2 
	  u0c21 u0c22 u10c2 llnate_nt21 llnate_nt22 llnate_nt2 ulnate_nt2 llnate_at21 llnate_at22 
	  llnate_at2 ulnate_at2  llnate_c02 ulnate_c02 llnate_c12 ulnate_c12 llmate_c0 ulmate_c0  
	  llmate_c1 ulmate_c1 LB_Delta_nt2 UB_Delta_nt2 LB_Delta_at2  UB_Delta_at2 
	  LB_Gamma2 UB_Gamma21 UB_Gamma22 lm2 um21 um22  um23 um24 um2 ln21 ln22 ln23 ln24 un2 ll2 ul21 ul22 ul23 ul24
	  l0nt31 l0nt32 u0nt3 l1at3 u1at31 u1at32 l0c3  u0c31 u0c32  l1c3 u1c3 l10c3 u10c31 u10c32  
	  l01c3 u01c3 llnate_nt3 ulnate_nt31 ulnate_nt32  ulnate_nt3 llnate_at3 ulnate_at31 ulnate_at32 
	  llnate_c031 llnate_c032 llnate_c03 ulnate_c031 ulnate_c032 ulnate_c03 llnate_c13 ulnate_c13 
	  llmate_c131 llmate_c132 ulmate_c13 llmate_c031 llmate_c032 ulmate_c03 LB_Delta_nt3 UB_Delta_nt31 UB_Delta_nt32 
	  LB_Delta_at3 UB_Delta_at31 UB_Delta_at32 LB_Gamma31 LB_Gamma32 UB_Gamma31 UB_Gamma32   
	  lmate3_1 lmate3_2 lmate3_3 lmate3_4 lmate3_5 lmate3_6 lmate3_7 lmate3_8 lmate3_9 lmate3_10 
	  lmate3_11 lmate3_12 lmate3_13 lmate3_14 lmate3_15 lmate3_16 umate3 lnate3 
	  unate3_1 unate3_2 unate3_3 unate3_4 unate3_5 unate3_6 unate3_7 unate3_8 unate3_9 unate3_10
	  unate3_11 unate3_12 unate3_13 unate3_14 unate3_15 unate3_16 
	  llate3_1  llate3_2 llate3_3  llate3_4 llate3_5  llate3_6 llate3_7 llate3_8 llate3_9 llate3_10 
	  llate3_11 llate3_12 llate3_13 llate3_14 llate3_15 llate3_16 ulate3
	  l0nt41 l0nt42 u0nt41 u0nt42 l1at41 l1at42 u1at41 u1at42 l0c41 u0c41 u0c42 u0c43 l1c41 
	  l1c42 u1c4 l10c41 u10c41 l01c41 u01c41 u01c42 llnate_nt41 llnate_nt42 llnate_nt4 
	  ulnate_nt41 ulnate_nt42 ulnate_nt4 llnate_at41 llnate_at42 llnate_at4 ulnate_at41 ulnate_at42 ulnate_at4  
	  llnate0_c4 ulnate0_c4 llnate1_c41 llnate1_c42 llnate1_c4 ulnate1_c4 llmate1_c4 ulmate1_c4  
	  llmate0_c4 ulmate0_c41 ulmate0_c42 LB_Delta_nt4 UB_Delta_nt41 UB_Delta_nt42 LB_Delta_at4 UB_Delta_at41 UB_Delta_at42  
	  LB_ATT41 UB_ATT41 UB_ATT42 UB_ATT43  lmate4 umate4_1 umate4_2 umate4_3  umate4_4  umate4_5 
	  umate4_6 umate4_7 umate4_8  umate4_9  umate4_10 umate4_11 umate4_12 umate4_13 umate4_14 umate4_15 
	  umate4_16 umate4_17 umate4_18  umate4_19  umate4_20 umate4_21 umate4_22 umate4_23 umate4_24 umate4_25
	  umate4_26 umate4_27 umate4_28  umate4_29  umate4_30 umate4_31 umate4_32 umate4_33 umate4_34 umate4_35
	  umate4_36 umate4_37 umate4_38  umate4_39  umate4_40 umate4_41 umate4_42 umate4_43 umate4_44 umate4_45
	  umate4_46 umate4_47 umate4_48  lnate4_1 lnate4_2 lnate4_3 lnate4_4 lnate4_5 lnate4_6 lnate4_7 
	  lnate4_8 lnate4_9 lnate4_10 lnate4_11 lnate4_12 lnate4_13 lnate4_14 lnate4_15 lnate4_16 lnate4_17
	  lnate4_18 lnate4_19 lnate4_20 lnate4_21 lnate4_22 lnate4_23 lnate4_24 lnate4_25 lnate4_26 lnate4_27
	  lnate4_28 lnate4_29 lnate4_30 lnate4_31 lnate4_32 lnate4_33 lnate4_34 lnate4_35 lnate4_36 lnate4_37
	  lnate4_38 lnate4_39 lnate4_40 lnate4_41 lnate4_42 lnate4_43 lnate4_44 lnate4_45 lnate4_46 lnate4_47
	  lnate4_48 unate4 llate4 ulate4_1 ulate4_2 ulate4_3 ulate4_4 ulate4_5 ulate4_6 ulate4_7 
	  ulate4_8 ulate4_9 ulate4_10 ulate4_11 ulate4_12 ulate4_13 ulate4_14 ulate4_15 ulate4_16 ulate4_17
	  ulate4_18 ulate4_19 ulate4_20 ulate4_21 ulate4_22 ulate4_23 ulate4_24 ulate4_25 ulate4_26 ulate4_27
	  ulate4_28 ulate4_29 ulate4_30 ulate4_31 ulate4_32 ulate4_33 ulate4_34 ulate4_35 ulate4_36 ulate4_37
	  ulate4_38 ulate4_39 ulate4_40 ulate4_41 ulate4_42 ulate4_43 ulate4_44 ulate4_45 ulate4_46 ulate4_47 
	  ulate4_48" ; 
	  
	  distinct monthYear_group if cohort_sample==1;  
	  local total_my=r(ndistinct) ; 
	  
	  foreach names_zero in $bounds {; 
	  di "`names_zero'"; 
	  sca `names_zero'_white$race =0; 
	  sca li `names_zero'_white$race; 
	  }; 
	  
	  forvalues x=1(1)`total_my'{; 
	    foreach names_zero in $bounds {; 
	    di "`names_zero'"; 
		sca li `names_zero'_white$race; 
	    sca li `names_zero'_`x'; 
	    sca li nz10_`x'; 
		sca li total_birth; 
		
		sca `names_zero'_white$race =`names_zero'_white$race +`names_zero'_`x'*(nz10_`x'/total_birth ); 
		sca li `names_zero'_white$race; 
	           }; 
		 }; 
	  
     #delimit ; 
*****LNATE_nt effect by percentage*********;
sca perc_lb_lnate_white$race =llnate_nt1_white$race /ey00_white$race ;
sca li perc_lb_lnate_white$race ;

sca perc_ub_lnate_white$race =ulnate_nt1_white$race /ey00_white$race ; 
sca li perc_ub_lnate_white$race ;

*****LATE_at effect by percentage*****; 
sca LB_perc_late_at_white$race =min(1, LB_Delta_at3_white$race /eyt0_white$race ); 
sca li LB_perc_late_at_white$race ;

sca UB_perc_late_at_white$race =min(1, min(UB_Delta_at31_white$race ,UB_Delta_at32_white$race )/eyt0_white$race);
sca li UB_perc_late_at_white$race ;

********The replication of Lindo's 2sls estimates**********; 
# delimit ;

   preserve; 

   keep if lindo==1; 
   global outcomescount = "criminal violent nonviolent violent_desistance nonviolent_desistance"	; 
   global mainoutcomes1 = "scriminal sviolent snonviolent sviolent_desistance snonviolent_desistance";

collapse (sum)  $outcomescount ///
             (mean) mob dob birth ygroup* fe_yob* yobmob fe_mob* induction ///
                     yeargroup survey1 survey2 survey3, /// 
					by(yob lotteryNumber white study) ; 
# delimit cr
					
	foreach var of varlist $outcomescount {
      gen s`var' = `var'/birth
    }		
	
    gen birth_weight=round(birth, 0.0001)


   set more off
  sca stage1_grp2_white1=0.0842
  sca stage1_grp2_white0=0.0493
  
  count if ygroup$lindo_yeargroup ==1
  
  * Reduced-Form Results 
	
	tab birth_weight
	
       display "$tsls_outcome for the birth year group $lindo_yeargroup" 
	      
			    xtset yobmob
				
			    xtreg $tsls_outcome induction if ygroup$lindo_yeargroup ==1 & white==$race [aweight=birth_weight], fe
				sum $tsls_outcome if induction==0 & e(sample)
				matrix temp = e(b)
			    scalar pctimpact = 100*temp[1,1]/r(mean)
				
				scalar veteffect_white$race = (temp[1,1])/stage1_grp2_white$race
				sca li veteffect_white$race
				
   restore 
   
   
   #delimit; 
   
   global late_bounds="ll2 ul21 ul22 ul23 ul24 
	                   llate3_1 llate3_2 llate3_3 llate3_4 llate3_5  
					   llate3_6 llate3_7 llate3_8 llate3_9 llate3_10  
	                   llate3_11 llate3_12 llate3_13 llate3_14 llate3_15 
					   llate3_16 ulate3 llate4 ulate4_1 
					   ulate4_2 ulate4_3 ulate4_4 ulate4_5 ulate4_6 
					   ulate4_7 ulate4_8 ulate4_9 ulate4_10 ulate4_11 
					   ulate4_12 ulate4_13 ulate4_14 ulate4_15 ulate4_16 
					   ulate4_17 ulate4_18 ulate4_19 ulate4_20 ulate4_21 
					   ulate4_22 ulate4_23 ulate4_24 ulate4_25 ulate4_26 
					   ulate4_27 ulate4_28 ulate4_29 ulate4_30 ulate4_31 
					   ulate4_32 ulate4_33 ulate4_34 ulate4_35 ulate4_36 
					   ulate4_37 ulate4_38 ulate4_39 ulate4_40 ulate4_41 
					   ulate4_42 ulate4_43 ulate4_44 ulate4_45 ulate4_46 
					   ulate4_47 ulate4_48"; 
					   
	#delimit cr			   
	
	foreach late_bounds in $late_bounds{ 
	
	di "difference between Lindo and Stoeckers 2sls and `late_bounds'"
	
	sca diff_2sls_`late_bounds'_white$race =veteffect_white$race -`late_bounds'_white$race 
	sca li diff_2sls_`late_bounds'_white$race 
	
	}
	
        	  
matrix I2_1=( n_sample_white$race, yu_white$race, yl_white$race, ///
		   ej_white$race, ey10_white$race, ey01_white$race, ey00_white$race, ey11_white$race, eyt1_white$race, eyt0_white$race, eyz0_white$race, eyz1_white$race, itt_white$race, /// 
		   tsls_white$race, ti1_white$race, ti2_white$race, ti3_white$race, eynt1_white$race, eyat0_white$race, l0nt1_white$race, u0nt1_white$race, l1at1_white$race, u1at1_white$race, /// 
		   llnate_nt1_white$race, ulnate_nt1_white$race, llnate_at1_white$race, ulnate_at1_white$race, LB_Delta1_white$race, /// 
		   UB_Delta1_white$race, LB_Gamma1_white$race, UB_Gamma1_white$race, LB_Delta_nt1_white$race, UB_Delta_nt1_white$race, /// 
		   LB_Delta_at1_white$race, UB_Delta_at1_white$race, l0nt2_white$race, u0nt21_white$race, u0nt22_white$race, ///  
           u0nt2_white$race, l1at21_white$race, l1at22_white$race, l1at2_white$race, u1at2_white$race, /// 
		   l0c2_white$race, l1c21_white$race, l1c22_white$race, l10c2_white$race, u1c2_white$race, /// 
		   u0c21_white$race, u0c22_white$race, u10c2_white$race, llnate_nt21_white$race, llnate_nt22_white$race, /// 
		   llnate_nt2_white$race, ulnate_nt2_white$race, llnate_at21_white$race, llnate_at22_white$race, llnate_at2_white$race, /// 
		   ulnate_at2_white$race, llnate_c02_white$race, ulnate_c02_white$race,  llnate_c12_white$race,  ulnate_c12_white$race, /// 
		   llmate_c0_white$race,  ulmate_c0_white$race,  llmate_c1_white$race, ulmate_c1_white$race, LB_Delta_nt2_white$race, ///
		   UB_Delta_nt2_white$race, LB_Delta_at2_white$race,  UB_Delta_at2_white$race, LB_Gamma2_white$race, UB_Gamma21_white$race, /// 
		   UB_Gamma22_white$race, lm2_white$race, um21_white$race, um22_white$race, um23_white$race, um24_white$race, um2_white$race, ln21_white$race, ln22_white$race, ln23_white$race, /// 
		   ln24_white$race, un2_white$race, ll2_white$race, ul21_white$race, ul22_white$race, ul23_white$race, ul24_white$race, l0nt31_white$race, l0nt32_white$race, u0nt3_white$race, /// 
		   l1at3_white$race, u1at31_white$race, u1at32_white$race, l0c3_white$race, u0c31_white$race, /// 
		   u0c32_white$race, l1c3_white$race, u1c3_white$race, l10c3_white$race, u10c31_white$race, /// 
		   u10c32_white$race, l01c3_white$race, u01c3_white$race, llnate_nt3_white$race, ulnate_nt31_white$race, /// 
		   ulnate_nt32_white$race, ulnate_nt3_white$race, llnate_at3_white$race, ulnate_at31_white$race, ulnate_at32_white$race, /// 
		   llnate_c031_white$race, llnate_c032_white$race, llnate_c03_white$race, ulnate_c031_white$race, ulnate_c032_white$race, /// 
		   ulnate_c03_white$race, llnate_c13_white$race, ulnate_c13_white$race, llmate_c131_white$race, llmate_c132_white$race, /// 
		   ulmate_c13_white$race, llmate_c031_white$race, llmate_c032_white$race, ulmate_c03_white$race, LB_Delta_nt3_white$race, /// 
		   UB_Delta_nt31_white$race, UB_Delta_nt32_white$race, LB_Delta_at3_white$race, UB_Delta_at31_white$race, UB_Delta_at32_white$race, /// 
		   LB_Gamma31_white$race, LB_Gamma32_white$race, UB_Gamma31_white$race, UB_Gamma32_white$race, /// 
		   lmate3_1_white$race, lmate3_2_white$race, lmate3_3_white$race, lmate3_4_white$race, lmate3_5_white$race, lmate3_6_white$race, lmate3_7_white$race, lmate3_8_white$race, lmate3_9_white$race, lmate3_10_white$race, ///  
	  lmate3_11_white$race, lmate3_12_white$race, lmate3_13_white$race, lmate3_14_white$race, lmate3_15_white$race, lmate3_16_white$race, umate3_white$race, lnate3_white$race, ///  
	  unate3_1_white$race, unate3_2_white$race, unate3_3_white$race, unate3_4_white$race, unate3_5_white$race, unate3_6_white$race, unate3_7_white$race, unate3_8_white$race, unate3_9_white$race, unate3_10_white$race, ///
	  unate3_11_white$race, unate3_12_white$race, unate3_13_white$race, unate3_14_white$race, unate3_15_white$race, unate3_16_white$race, ///
	  llate3_1_white$race, llate3_2_white$race, llate3_3_white$race, llate3_4_white$race, llate3_5_white$race, llate3_6_white$race, llate3_7_white$race, llate3_8_white$race, llate3_9_white$race, llate3_10_white$race, /// 
	  llate3_11_white$race, llate3_12_white$race, llate3_13_white$race, llate3_14_white$race, llate3_15_white$race, llate3_16_white$race, ulate3_white$race)
	
matrix colnames I2_1 =  n_sample_white$race, yu_white$race, yl_white$race, ///
		   ej_white$race, ey10_white$race, ey01_white$race, ey00_white$race, ey11_white$race, eyt1_white$race, eyt0_white$race, eyz0_white$race, eyz1_white$race, itt_white$race, /// 
		   tsls_white$race, ti1_white$race, ti2_white$race, ti3_white$race, eynt1_white$race, eyat0_white$race, l0nt1_white$race, u0nt1_white$race, l1at1_white$race, u1at1_white$race, /// 
		   llnate_nt1_white$race, ulnate_nt1_white$race, llnate_at1_white$race, ulnate_at1_white$race, LB_Delta1_white$race, /// 
		   UB_Delta1_white$race, LB_Gamma1_white$race, UB_Gamma1_white$race, LB_Delta_nt1_white$race, UB_Delta_nt1_white$race, /// 
		   LB_Delta_at1_white$race, UB_Delta_at1_white$race, l0nt2_white$race, u0nt21_white$race, u0nt22_white$race, ///  
           u0nt2_white$race, l1at21_white$race, l1at22_white$race, l1at2_white$race, u1at2_white$race, /// 
		   l0c2_white$race, l1c21_white$race, l1c22_white$race, l10c2_white$race, u1c2_white$race, /// 
		   u0c21_white$race, u0c22_white$race, u10c2_white$race, llnate_nt21_white$race, llnate_nt22_white$race, /// 
		   llnate_nt2_white$race, ulnate_nt2_white$race, llnate_at21_white$race, llnate_at22_white$race, llnate_at2_white$race, /// 
		   ulnate_at2_white$race, llnate_c02_white$race, ulnate_c02_white$race,  llnate_c12_white$race,  ulnate_c12_white$race, /// 
		   llmate_c0_white$race,  ulmate_c0_white$race,  llmate_c1_white$race, ulmate_c1_white$race, LB_Delta_nt2_white$race, ///
		   UB_Delta_nt2_white$race, LB_Delta_at2_white$race,  UB_Delta_at2_white$race, LB_Gamma2_white$race, UB_Gamma21_white$race, /// 
		   UB_Gamma22_white$race, lm2_white$race, um21_white$race, um22_white$race, um23_white$race, um24_white$race, um2_white$race, ln21_white$race, ln22_white$race, ln23_white$race, /// 
		   ln24_white$race, un2_white$race, ll2_white$race, ul21_white$race, ul22_white$race, ul23_white$race, ul24_white$race, l0nt31_white$race, l0nt32_white$race, u0nt3_white$race, /// 
		   l1at3_white$race, u1at31_white$race, u1at32_white$race, l0c3_white$race, u0c31_white$race, /// 
		   u0c32_white$race, l1c3_white$race, u1c3_white$race, l10c3_white$race, u10c31_white$race, /// 
		   u10c32_white$race, l01c3_white$race, u01c3_white$race, llnate_nt3_white$race, ulnate_nt31_white$race, /// 
		   ulnate_nt32_white$race, ulnate_nt3_white$race, llnate_at3_white$race, ulnate_at31_white$race, ulnate_at32_white$race, /// 
		   llnate_c031_white$race, llnate_c032_white$race, llnate_c03_white$race, ulnate_c031_white$race, ulnate_c032_white$race, /// 
		   ulnate_c03_white$race, llnate_c13_white$race, ulnate_c13_white$race, llmate_c131_white$race, llmate_c132_white$race, /// 
		   ulmate_c13_white$race, llmate_c031_white$race, llmate_c032_white$race, ulmate_c03_white$race, LB_Delta_nt3_white$race, /// 
		   UB_Delta_nt31_white$race, UB_Delta_nt32_white$race, LB_Delta_at3_white$race, UB_Delta_at31_white$race, UB_Delta_at32_white$race, /// 
		   LB_Gamma31_white$race, LB_Gamma32_white$race, UB_Gamma31_white$race, UB_Gamma32_white$race, /// 
		   lmate3_1_white$race, lmate3_2_white$race, lmate3_3_white$race, lmate3_4_white$race, lmate3_5_white$race, lmate3_6_white$race, lmate3_7_white$race, lmate3_8_white$race, lmate3_9_white$race, lmate3_10_white$race, ///  
	  lmate3_11_white$race, lmate3_12_white$race, lmate3_13_white$race, lmate3_14_white$race, lmate3_15_white$race, lmate3_16_white$race, umate3_white$race, lnate3_white$race, ///  
	  unate3_1_white$race, unate3_2_white$race, unate3_3_white$race, unate3_4_white$race, unate3_5_white$race, unate3_6_white$race, unate3_7_white$race, unate3_8_white$race, unate3_9_white$race, unate3_10_white$race, ///
	  unate3_11_white$race, unate3_12_white$race, unate3_13_white$race, unate3_14_white$race, unate3_15_white$race, unate3_16_white$race, ///
	  llate3_1_white$race, llate3_2_white$race, llate3_3_white$race, llate3_4_white$race, llate3_5_white$race, llate3_6_white$race, llate3_7_white$race, llate3_8_white$race, llate3_9_white$race, llate3_10_white$race, /// 
	  llate3_11_white$race, llate3_12_white$race, llate3_13_white$race, llate3_14_white$race, llate3_15_white$race, llate3_16_white$race, ulate3_white$race
	
	
matrix I2_2=(l0nt41_white$race, l0nt42_white$race, u0nt41_white$race, /// 
		   u0nt42_white$race, l1at41_white$race, l1at42_white$race, u1at41_white$race, u1at42_white$race, /// 
		   l0c41_white$race, u0c41_white$race, u0c42_white$race, u0c43_white$race, l1c41_white$race, /// 
		   l1c42_white$race, u1c4_white$race, l10c41_white$race, u10c41_white$race, l01c41_white$race, /// 
		   u01c41_white$race, u01c42_white$race, llnate_nt41_white$race, llnate_nt42_white$race, llnate_nt4_white$race, /// 
		   ulnate_nt41_white$race, ulnate_nt42_white$race, ulnate_nt4_white$race, llnate_at41_white$race, llnate_at42_white$race, /// 
		   llnate_at4_white$race, ulnate_at41_white$race, ulnate_at42_white$race, ulnate_at4_white$race,  llnate0_c4_white$race, /// 
		   ulnate0_c4_white$race, llnate1_c41_white$race, llnate1_c42_white$race, llnate1_c4_white$race,  ulnate1_c4_white$race, /// 
		   llmate1_c4_white$race, ulmate1_c4_white$race,  llmate0_c4_white$race,  ulmate0_c41_white$race, ulmate0_c42_white$race, /// 
		   LB_Delta_nt4_white$race, UB_Delta_nt41_white$race, UB_Delta_nt42_white$race, LB_Delta_at4_white$race, UB_Delta_at41_white$race, /// 
		   UB_Delta_at42_white$race, LB_ATT41_white$race, UB_ATT41_white$race, UB_ATT42_white$race, UB_ATT43_white$race, /// 
		   lmate4_white$race, umate4_1_white$race, umate4_2_white$race, umate4_3_white$race,  umate4_4_white$race, /// 
		   umate4_5_white$race, umate4_6_white$race, umate4_7_white$race, umate4_8_white$race,  umate4_9_white$race, /// 
		   umate4_10_white$race, umate4_11_white$race, umate4_12_white$race, umate4_13_white$race,  umate4_14_white$race, ///
		   umate4_15_white$race, umate4_16_white$race, umate4_17_white$race, umate4_18_white$race,  umate4_19_white$race, umate4_20_white$race, /// 
		   umate4_21_white$race, umate4_22_white$race, umate4_23_white$race, umate4_24_white$race, umate4_25_white$race, umate4_26_white$race, ///  
	       umate4_27_white$race, umate4_28_white$race, umate4_29_white$race, umate4_30_white$race, umate4_31_white$race, umate4_32_white$race, /// 
		   umate4_33_white$race, umate4_34_white$race, umate4_35_white$race, umate4_36_white$race, umate4_37_white$race, umate4_38_white$race, ///   
	       umate4_39_white$race, umate4_40_white$race, umate4_41_white$race, umate4_42_white$race, umate4_43_white$race, umate4_44_white$race, ///
		   umate4_45_white$race, umate4_46_white$race, umate4_47_white$race, umate4_48_white$race, /// 
		   lnate4_1_white$race, lnate4_2_white$race, lnate4_3_white$race, lnate4_4_white$race, lnate4_5_white$race, lnate4_6_white$race, lnate4_7_white$race, /// 
	  lnate4_8_white$race, lnate4_9_white$race, lnate4_10_white$race, lnate4_11_white$race, lnate4_12_white$race, lnate4_13_white$race, lnate4_14_white$race, lnate4_15_white$race, lnate4_16_white$race, lnate4_17_white$race, ///
	  lnate4_18_white$race, lnate4_19_white$race, lnate4_20_white$race, lnate4_21_white$race, lnate4_22_white$race, lnate4_23_white$race, lnate4_24_white$race, lnate4_25_white$race, lnate4_26_white$race, lnate4_27_white$race, ///
	  lnate4_28_white$race, lnate4_29_white$race, lnate4_30_white$race, lnate4_31_white$race, lnate4_32_white$race, lnate4_33_white$race, lnate4_34_white$race, lnate4_35_white$race, lnate4_36_white$race, lnate4_37_white$race, ///
	  lnate4_38_white$race, lnate4_39_white$race, lnate4_40_white$race, lnate4_41_white$race, lnate4_42_white$race, lnate4_43_white$race, lnate4_44_white$race, lnate4_45_white$race, lnate4_46_white$race, lnate4_47_white$race, ///
	  lnate4_48_white$race, unate4_white$race, llate4_white$race, ulate4_1_white$race, ulate4_2_white$race, ulate4_3_white$race, ulate4_4_white$race, ulate4_5_white$race, ulate4_6_white$race, ulate4_7_white$race, /// 
	  ulate4_8_white$race, ulate4_9_white$race, ulate4_10_white$race, ulate4_11_white$race, ulate4_12_white$race, ulate4_13_white$race, ulate4_14_white$race, ulate4_15_white$race, ulate4_16_white$race, ulate4_17_white$race, ///
	  ulate4_18_white$race, ulate4_19_white$race, ulate4_20_white$race, ulate4_21_white$race, ulate4_22_white$race, ulate4_23_white$race, ulate4_24_white$race, ulate4_25_white$race, ulate4_26_white$race, ulate4_27_white$race, ///
	  ulate4_28_white$race, ulate4_29_white$race, ulate4_30_white$race, ulate4_31_white$race, ulate4_32_white$race, ulate4_33_white$race, ulate4_34_white$race, ulate4_35_white$race, ulate4_36_white$race, ulate4_37_white$race, ///
	  ulate4_38_white$race, ulate4_39_white$race, ulate4_40_white$race, ulate4_41_white$race, ulate4_42_white$race, ulate4_43_white$race, ulate4_44_white$race, ulate4_45_white$race, ulate4_46_white$race, ulate4_47_white$race, /// 
	  ulate4_48_white$race, perc_lb_lnate_white$race, perc_ub_lnate_white$race, LB_perc_late_at_white$race, UB_perc_late_at_white$race,  /// 
	  veteffect_white$race, diff_2sls_ll2_white$race, diff_2sls_ul21_white$race, diff_2sls_ul22_white$race, diff_2sls_ul23_white$race, diff_2sls_ul24_white$race, /// 
	  diff_2sls_llate3_1_white$race, diff_2sls_llate3_2_white$race, diff_2sls_llate3_3_white$race, diff_2sls_llate3_4_white$race, diff_2sls_llate3_5_white$race, ///  
	  diff_2sls_llate3_6_white$race, diff_2sls_llate3_7_white$race, diff_2sls_llate3_8_white$race, diff_2sls_llate3_9_white$race, diff_2sls_llate3_10_white$race, /// 
	  diff_2sls_llate3_11_white$race, diff_2sls_llate3_12_white$race, diff_2sls_llate3_13_white$race, diff_2sls_llate3_14_white$race, diff_2sls_llate3_15_white$race, /// 
	  diff_2sls_llate3_16_white$race, diff_2sls_ulate3_white$race, /// 
	  diff_2sls_llate4_white$race, diff_2sls_ulate4_1_white$race, diff_2sls_ulate4_2_white$race, diff_2sls_ulate4_3_white$race, diff_2sls_ulate4_4_white$race, diff_2sls_ulate4_5_white$race, diff_2sls_ulate4_6_white$race, /// 
	  diff_2sls_ulate4_7_white$race, diff_2sls_ulate4_8_white$race, diff_2sls_ulate4_9_white$race, diff_2sls_ulate4_10_white$race, diff_2sls_ulate4_11_white$race, diff_2sls_ulate4_12_white$race, diff_2sls_ulate4_13_white$race, diff_2sls_ulate4_14_white$race, diff_2sls_ulate4_15_white$race, diff_2sls_ulate4_16_white$race, /// 
	  diff_2sls_ulate4_17_white$race, diff_2sls_ulate4_18_white$race, diff_2sls_ulate4_19_white$race, diff_2sls_ulate4_20_white$race, diff_2sls_ulate4_21_white$race, diff_2sls_ulate4_22_white$race, diff_2sls_ulate4_23_white$race, diff_2sls_ulate4_24_white$race, diff_2sls_ulate4_25_white$race, diff_2sls_ulate4_26_white$race, /// 
	  diff_2sls_ulate4_27_white$race, diff_2sls_ulate4_28_white$race, diff_2sls_ulate4_29_white$race, diff_2sls_ulate4_30_white$race, diff_2sls_ulate4_31_white$race, diff_2sls_ulate4_32_white$race, diff_2sls_ulate4_33_white$race, diff_2sls_ulate4_34_white$race, diff_2sls_ulate4_35_white$race, diff_2sls_ulate4_36_white$race, ///
	  diff_2sls_ulate4_37_white$race, diff_2sls_ulate4_38_white$race, diff_2sls_ulate4_39_white$race, diff_2sls_ulate4_40_white$race, diff_2sls_ulate4_41_white$race, diff_2sls_ulate4_42_white$race, diff_2sls_ulate4_43_white$race, diff_2sls_ulate4_44_white$race, diff_2sls_ulate4_45_white$race, diff_2sls_ulate4_46_white$race, /// 
	  diff_2sls_ulate4_47_white$race, diff_2sls_ulate4_48_white$race ) 
		   
matrix colnames I2_2 = l0nt41_white$race, l0nt42_white$race, u0nt41_white$race, /// 
		   u0nt42_white$race, l1at41_white$race, l1at42_white$race, u1at41_white$race, u1at42_white$race, /// 
		   l0c41_white$race, u0c41_white$race, u0c42_white$race, u0c43_white$race, l1c41_white$race, /// 
		   l1c42_white$race, u1c4_white$race, l10c41_white$race, u10c41_white$race, l01c41_white$race, /// 
		   u01c41_white$race, u01c42_white$race, llnate_nt41_white$race, llnate_nt42_white$race, llnate_nt4_white$race, /// 
		   ulnate_nt41_white$race, ulnate_nt42_white$race, ulnate_nt4_white$race, llnate_at41_white$race, llnate_at42_white$race, /// 
		   llnate_at4_white$race, ulnate_at41_white$race, ulnate_at42_white$race, ulnate_at4_white$race,  llnate0_c4_white$race, /// 
		   ulnate0_c4_white$race, llnate1_c41_white$race, llnate1_c42_white$race, llnate1_c4_white$race,  ulnate1_c4_white$race, /// 
		   llmate1_c4_white$race, ulmate1_c4_white$race,  llmate0_c4_white$race,  ulmate0_c41_white$race, ulmate0_c42_white$race, /// 
		   LB_Delta_nt4_white$race, UB_Delta_nt41_white$race, UB_Delta_nt42_white$race, LB_Delta_at4_white$race, UB_Delta_at41_white$race, /// 
		   UB_Delta_at42_white$race, LB_ATT41_white$race, UB_ATT41_white$race, UB_ATT42_white$race, UB_ATT43_white$race, /// 
		   lmate4_white$race, umate4_1_white$race, umate4_2_white$race, umate4_3_white$race,  umate4_4_white$race, /// 
		   umate4_5_white$race, umate4_6_white$race, umate4_7_white$race, umate4_8_white$race,  umate4_9_white$race, /// 
		   umate4_10_white$race, umate4_11_white$race, umate4_12_white$race, umate4_13_white$race,  umate4_14_white$race, ///
		   umate4_15_white$race, umate4_16_white$race, umate4_17_white$race, umate4_18_white$race,  umate4_19_white$race, umate4_20_white$race, /// 
		   umate4_21_white$race, umate4_22_white$race, umate4_23_white$race, umate4_24_white$race, umate4_25_white$race, umate4_26_white$race, ///  
	       umate4_27_white$race, umate4_28_white$race, umate4_29_white$race, umate4_30_white$race, umate4_31_white$race, umate4_32_white$race, /// 
		   umate4_33_white$race, umate4_34_white$race, umate4_35_white$race, umate4_36_white$race, umate4_37_white$race, umate4_38_white$race, ///   
	       umate4_39_white$race, umate4_40_white$race, umate4_41_white$race, umate4_42_white$race, umate4_43_white$race, umate4_44_white$race, ///
		   umate4_45_white$race, umate4_46_white$race, umate4_47_white$race, umate4_48_white$race, /// 
		   lnate4_1_white$race, lnate4_2_white$race, lnate4_3_white$race, lnate4_4_white$race, lnate4_5_white$race, lnate4_6_white$race, lnate4_7_white$race, /// 
	  lnate4_8_white$race, lnate4_9_white$race, lnate4_10_white$race, lnate4_11_white$race, lnate4_12_white$race, lnate4_13_white$race, lnate4_14_white$race, lnate4_15_white$race, lnate4_16_white$race, lnate4_17_white$race, ///
	  lnate4_18_white$race, lnate4_19_white$race, lnate4_20_white$race, lnate4_21_white$race, lnate4_22_white$race, lnate4_23_white$race, lnate4_24_white$race, lnate4_25_white$race, lnate4_26_white$race, lnate4_27_white$race, ///
	  lnate4_28_white$race, lnate4_29_white$race, lnate4_30_white$race, lnate4_31_white$race, lnate4_32_white$race, lnate4_33_white$race, lnate4_34_white$race, lnate4_35_white$race, lnate4_36_white$race, lnate4_37_white$race, ///
	  lnate4_38_white$race, lnate4_39_white$race, lnate4_40_white$race, lnate4_41_white$race, lnate4_42_white$race, lnate4_43_white$race, lnate4_44_white$race, lnate4_45_white$race, lnate4_46_white$race, lnate4_47_white$race, ///
	  lnate4_48_white$race, unate4_white$race, llate4_white$race, ulate4_1_white$race, ulate4_2_white$race, ulate4_3_white$race, ulate4_4_white$race, ulate4_5_white$race, ulate4_6_white$race, ulate4_7_white$race, /// 
	  ulate4_8_white$race, ulate4_9_white$race, ulate4_10_white$race, ulate4_11_white$race, ulate4_12_white$race, ulate4_13_white$race, ulate4_14_white$race, ulate4_15_white$race, ulate4_16_white$race, ulate4_17_white$race, ///
	  ulate4_18_white$race, ulate4_19_white$race, ulate4_20_white$race, ulate4_21_white$race, ulate4_22_white$race, ulate4_23_white$race, ulate4_24_white$race, ulate4_25_white$race, ulate4_26_white$race, ulate4_27_white$race, ///
	  ulate4_28_white$race, ulate4_29_white$race, ulate4_30_white$race, ulate4_31_white$race, ulate4_32_white$race, ulate4_33_white$race, ulate4_34_white$race, ulate4_35_white$race, ulate4_36_white$race, ulate4_37_white$race, ///
	  ulate4_38_white$race, ulate4_39_white$race, ulate4_40_white$race, ulate4_41_white$race, ulate4_42_white$race, ulate4_43_white$race, ulate4_44_white$race, ulate4_45_white$race, ulate4_46_white$race, ulate4_47_white$race, /// 
	  ulate4_48_white$race, perc_lb_lnate_white$race, perc_ub_lnate_white$race, LB_perc_late_at_white$race, UB_perc_late_at_white$race,  /// 
	  veteffect_white$race, diff_2sls_ll2_white$race, diff_2sls_ul21_white$race, diff_2sls_ul22_white$race, diff_2sls_ul23_white$race, diff_2sls_ul24_white$race, /// 
	  diff_2sls_llate3_1_white$race, diff_2sls_llate3_2_white$race, diff_2sls_llate3_3_white$race, diff_2sls_llate3_4_white$race, diff_2sls_llate3_5_white$race, ///  
	  diff_2sls_llate3_6_white$race, diff_2sls_llate3_7_white$race, diff_2sls_llate3_8_white$race, diff_2sls_llate3_9_white$race, diff_2sls_llate3_10_white$race, /// 
	  diff_2sls_llate3_11_white$race, diff_2sls_llate3_12_white$race, diff_2sls_llate3_13_white$race, diff_2sls_llate3_14_white$race, diff_2sls_llate3_15_white$race, /// 
	  diff_2sls_llate3_16_white$race, diff_2sls_ulate3_white$race, /// 
	  diff_2sls_llate4_white$race, diff_2sls_ulate4_1_white$race, diff_2sls_ulate4_2_white$race, diff_2sls_ulate4_3_white$race, diff_2sls_ulate4_4_white$race, diff_2sls_ulate4_5_white$race, diff_2sls_ulate4_6_white$race, /// 
	  diff_2sls_ulate4_7_white$race, diff_2sls_ulate4_8_white$race, diff_2sls_ulate4_9_white$race, diff_2sls_ulate4_10_white$race, diff_2sls_ulate4_11_white$race, diff_2sls_ulate4_12_white$race, diff_2sls_ulate4_13_white$race, diff_2sls_ulate4_14_white$race, diff_2sls_ulate4_15_white$race, diff_2sls_ulate4_16_white$race, /// 
	  diff_2sls_ulate4_17_white$race, diff_2sls_ulate4_18_white$race, diff_2sls_ulate4_19_white$race, diff_2sls_ulate4_20_white$race, diff_2sls_ulate4_21_white$race, diff_2sls_ulate4_22_white$race, diff_2sls_ulate4_23_white$race, diff_2sls_ulate4_24_white$race, diff_2sls_ulate4_25_white$race, diff_2sls_ulate4_26_white$race, /// 
	  diff_2sls_ulate4_27_white$race, diff_2sls_ulate4_28_white$race, diff_2sls_ulate4_29_white$race, diff_2sls_ulate4_30_white$race, diff_2sls_ulate4_31_white$race, diff_2sls_ulate4_32_white$race, diff_2sls_ulate4_33_white$race, diff_2sls_ulate4_34_white$race, diff_2sls_ulate4_35_white$race, diff_2sls_ulate4_36_white$race, ///
	  diff_2sls_ulate4_37_white$race, diff_2sls_ulate4_38_white$race, diff_2sls_ulate4_39_white$race, diff_2sls_ulate4_40_white$race, diff_2sls_ulate4_41_white$race, diff_2sls_ulate4_42_white$race, diff_2sls_ulate4_43_white$race, diff_2sls_ulate4_44_white$race, diff_2sls_ulate4_45_white$race, diff_2sls_ulate4_46_white$race, /// 
	  diff_2sls_ulate4_47_white$race, diff_2sls_ulate4_48_white$race
	  
mat I2=(I2_1, I2_2)	    
	
mat li I2
		   
ereturn clear
ereturn post I2, esample (`touse') properties ("b")
ereturn local cmd "I2_pop_racial_be"

end
